package com.iflytek.springboot_medicine.controller;

import com.iflytek.springboot_medicine.entity.Apply;
import com.iflytek.springboot_medicine.pojo.ResponseMessage;
import com.iflytek.springboot_medicine.service.impl.ApplyServiceImpl;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/apply")
public class ApplyController {
    private final ApplyServiceImpl applyService;
    public ApplyController(ApplyServiceImpl applyService) {
        this.applyService = applyService;
    }


    @RequestMapping("/addApply")
    public ResponseMessage<Apply> addShopping(@RequestBody Apply apply) {
        if (apply == null) {
            return ResponseMessage.error("添加失败");
        }
        Apply apply1 = applyService.addApply(apply);
        return ResponseMessage.success(apply1);
    }
}
